home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Pascal / Games / Stella Obscura 1.1 / source / Parts ƒ / ViewerConstruct.p < prev   
Encoding:
Text File  |  1990-05-13  |  2.4 KB  |  114 lines  |  [TEXT/PJMM]

  1. unit viewerConstruct;
  2.  
  3. interface
  4.  
  5.     procedure D_viewerConstruct;
  6.  
  7. implementation
  8.  
  9.     const
  10.         I_Okay = 1;
  11.         I_Static_Text = 2;
  12.         I_Static_Text3 = 3;
  13.         I_Static_Text5 = 4;
  14.         I_Static_Text7 = 5;
  15.         I_Static_Text9 = 6;
  16.         I_Static_Text11 = 7;
  17.         I_Static_Text13 = 8;
  18.         I_Static_Text15 = 9;
  19.         I_Static_Text17 = 10;
  20.         I_Static_Text19 = 11;
  21.         I_Static_Text21 = 12;
  22.         I_Static_Text23 = 13;
  23.         I_Static_Text25 = 14;
  24.         I_Static_Text27 = 15;
  25.         I_Static_Text29 = 16;
  26.         I_Static_Text31 = 17;
  27.         I_Static_Text33 = 18;
  28.         I_Picturex35 = 19;
  29.         I_Picturex36 = 20;
  30.     var
  31.         ExitDialog: boolean;
  32.  
  33. {===========================================================}
  34.  
  35.     function MyFilter (theDialog: DialogPtr; var theEvent: EventRecord; var itemHit: integer): boolean;
  36.         var
  37.             DoubleClick: boolean;
  38.             MyPt: Point;
  39.             tempRect: Rect;
  40.     begin
  41.         MyFilter := FALSE;
  42.         if (theEvent.what = MouseDown) then
  43.             begin
  44.                 MyPt := theEvent.where;
  45.                 with theDialog^.portBits.bounds do
  46.                     begin
  47.                         myPt.h := myPt.h + left;
  48.                         myPt.v := myPt.v + top;
  49.                     end;
  50.             end;
  51.     end;
  52.  
  53. {===========================================================}
  54.  
  55.     procedure D_viewerConstruct;
  56.         var
  57.             GetSelection: DialogPtr;
  58.             tempRect: Rect;
  59.             DType: Integer;
  60.             Index: Integer;
  61.             DItem: Handle;
  62.             CItem, CTempItem: controlhandle;
  63.             sTemp: Str255;
  64.             itemHit: Integer;
  65.             temp: Integer;
  66.             Icon_Handle: Handle;
  67.             NewMouse: Point;
  68.             InIcon: boolean;
  69.             ThisEditText: TEHandle;
  70.             TheDialogPtr: DialogPeek;
  71.  
  72.         procedure Refresh_Dialog;
  73.             var
  74.                 rTempRect: Rect;
  75.         begin
  76.         end;
  77.  
  78.     begin
  79.         GetSelection := GetNewDialog(2, nil, Pointer(-1));
  80.         ShowWindow(GetSelection);
  81.         SelectWindow(GetSelection);
  82.         SetPort(GetSelection);
  83.         TheDialogPtr := DialogPeek(GetSelection);
  84.         ThisEditText := TheDialogPtr^.textH;
  85.         HLock(Handle(ThisEditText));
  86.         ThisEditText^^.txSize := 9;
  87.         TextSize(9);
  88.         ThisEditText^^.txFont := geneva;
  89.         TextFont(geneva);
  90.         ThisEditText^^.txFont := 3;
  91.         ThisEditText^^.fontAscent := 10;
  92.         ThisEditText^^.lineHeight := 10 + 2 + 0;
  93.         HUnLock(Handle(ThisEditText));
  94.         ExitDialog := FALSE;
  95.         repeat
  96.             ModalDialog(nil, itemHit);
  97.             GetDItem(GetSelection, itemHit, DType, DItem, tempRect);
  98.             CItem := Pointer(DItem);
  99.             if (ItemHit = I_Okay) then
  100.                 begin
  101.                     ExitDialog := TRUE;
  102.                     Refresh_Dialog;
  103.                 end;
  104.             if (ItemHit = I_Picturex35) then
  105.                 begin
  106.                 end;
  107.             if (ItemHit = I_Picturex36) then
  108.                 begin
  109.                 end;
  110.         until ExitDialog;
  111.         DisposDialog(GetSelection);
  112.     end;
  113.  
  114. end.                                    {End of unit}